<?php
    namespace App\Services\Login;
    use App\Services\CommonService;
    use App\Model\Login;

    class LoginService extends CommonService{
        public function openid($code){
            //接收code,设置网址
            $appId = "wx94335db8fb1ca790";
            $secret = "54eddf8a7a3b6f70763bfe1ddaaf47a7";
            //拼接请求地址
            $url = "https://api.weixin.qq.com/sns/jscode2session?appid=$appId&secret=$secret&js_code=$code&grant_type=authorization_code";
            //执行获取
            $data = file_get_contents($url);
            return $data;
        }
    }